Implemented states, a working example is also provided