Modified sum function in the dataAnalysis