Added GUI and improved code