Refactored loop notation.

Removed unused index and bound value in the for statement directly.