format outputs into arrays