added logic for rps decision making