Version with my own sum function.