Sum is being returned in the function