Reverted change to loop, get it back to processing in correct order