fixed test script to generalize for other arrayed outputs