1. State machine needed to be modified so changing of state could be only possible withnin the state object and not outside. Super.currentState is now Super._getCurrentState. In the return function of CONTEXT object current state is now a function which gets the current state so using it now becomes a bit different. Added internal(private) method 'getStateByName', and also a private method getCurrentState