Could this be made into a for-each loop?