read data and find min and max