Adding min, max and sum functionality