Using summation algorithm
Improved recursive method