fixed missing sign for perpendicular test