working through rule, implementing Graph.pretty