Slightly restructured the state-related classes and provided a simple example of use