adding functionality to the gui