change LinkedList to ArrayList