Thanks to BCTheEntity for creating the logic for the RP with KQR.