Replace LinkedLists with ArrayLists