added recusive exponential summation function