slight rewrite of main gui file