improve initial array creation
Added header line to output