Implement rcs.cpp