making sum independent of foldLeft