Removed instances of instanceof, not switching between LinkedList and ArrayList, since I wasn't doing it correctly