Write a function that calculates the sum of a list of numbers