switched to a proper for loop for order integrity