Making the function return the sum