switched to receiving arraylist