Implemented a working state machine and conditions