adding mapping function (not done yet)
Adding a sum function instead of a for loop