Added some testing to state tracking