Might want to use a LinkedList here, I think the ArrayList constructor allocates an array with initial size 10.