Solution for SumInLoop