Adding avg, min, and max functions