implemented js rps