Changes made to the logic of the gui

Still not working...