removed unneeded patterns from reverseLinkedList