Added code to calculate the maximum number of areas for the x and y axis of the map.