clean up of Graph.scala
refactored graph generation