Testing State machine

Everything compiling. Testing state machine functionalities.