found minMax x and y values