change linked list to array list