Slightly improved new shift method to save node popped of stateStack