Completed first 'sum' method