improved state transition