adding rowMax and rowMin