Changed the GUI to work with resizing and maximizing.