Replace LinkedList with ArrayList