added more logic and wrote some helper functions and comments of how to create the graph given the input file