Changed LinkedList to ArrayList