Revert "Array map instead of for"

This reverts commit 979f426e3d66044fd8dfe09e19e34556d5b9f40c.