Changed factorial's function to use lambda; Implement accumulate and summation