Changed use of for-in loop