Added two distinct functions for left and right perpendicular