Switch to LinkedLists instead of ArrayLists, as noted by @xCompWiz