added high level state machine to controller class