word counter with single linked list