Fixed the 2D recursive algo with max finding