Added functionality to read input from file and to output the output to the GUI.