Updated to use point_in_rectangle