Added tail_recursion:sum/2 using an accumulating parameter