use arrays rather than lists in Apply