Added update funtion to the GUI.