minor changes in gui, added some event handlers