correct output to array