added comment to min and max calculations