* Added logic to perform the turn's switch

* Added architecture of state machine