Neatened up the GUI code a bit