replace arrayList with array