added functions: min, max, avg, sum and count