modified:   rps.cpp