lab5 graph building