Added expanded view of the inner loop's repeat condition.