added getPerpendicular function with swivel functions