update state manager functionality
added documentation for the state manager
added tests for the state manager