get the maximum value for each row