Finshed creating summation function