Fixed graph_solution, added optparse and comments