some work on the gui logic