add fucntion to find the minimun and maximum of both x & y in data points