basic summing function