Modify orientation function