Front end needs to be finished and the program will be completed. Also need to add message when the graph input is not correct