fixin wich.max value
fixing which.max value