Revert "use enumerate function to iterate through array with indexes"

This reverts commit cead409dc56021cc3247a074dfcf2de901f9ff76.