midified rm.c