Re-works the orient function.