change array creation to new method