fixing logic of the quadrant checks and added appropriate recursive
calls within each.