Corrected a docstring spelling error.
Added functionality and option to have the number of state-to-state transitions recorded.