added perpendicular lines implementation