bug fixes + perpendicular offset