breaking the first iteration if first + current > sum