Implemented RYW and primary retirement and bug fixes