Make substitution rotation-aware