Added nested loop.