now using LinkedList instead of ArrayList