updated projection to handle box intersections correctly