More statemachine work