check_RP and redeem functions created