major overhaul to rr_graph.c (before testing)