reformat and limite array length