Implemented statemachine State and the main class