clean up rip.c