Start implementing state machine