Refactored lookup method in LinkedList to use recursion instead of a loop.