Updated drawing of graph, added comments to functions