not happy, need to work on state machine