use for instead of for-each