completely breaking the graph stuff out of the main code