refactored gui, implemented startup