summation of start point to end point
foreach