Better way to output array