public void OneRewind()
    {
        int statesremoved = CurrentStateGroup.Rewind();

        if (statesremoved != -1)
        {//the current stategroup has finished rewinding
            //but has it finished rewinding because it reached the max allowed number of recorded states or because it has run out of states?
            if (statesremoved < StateDeltasGroup.MaxNumOfStates)
            {//it has run out of states
                //we want to remove this state group if we have others
                if (_stateDeltasGroups.Count > 1)
                {
                    _stateDeltasGroups.Remove(CurrentStateGroup);
                    CurrentStateGroup = _stateDeltasGroups[_stateDeltasGroups.Count - 1];
                    CurrentStateGroup.ResetStatesRemovedDuringRewindingCounter();
                }
                else
                {
                    IsRewinding = false;
                }
            }
            else
            {
                IsRewinding = false;
            }
        }
    }
 public void InitiateRewinding()
 {
     IsRewinding = true;
     CurrentStateGroup.ResetStatesRemovedDuringRewindingCounter();
 }