reformat double array