with arrayList functionality