Starting to work on the GUI state machine