Adding Functionality to gui