some gate constants and movingToGate logic