Modify finalStates function