Update

Correcting the iteration logic.