sum loop