Added a solution to the sums loop problem.