Consolidated output4 loading for loop into output2 loop.