use main array with files