refactored walkArray() for more flexible optimization testing (also removed the aggregate return, and thus enabled the warning again)