now populate array, then write to file