some documentation, add getPreviousState method