update for get rid of max and min