working single threaded linked list