created 3 functions that calculate sum, mean and median