Finding min and max coords.