add reset function

for resetting linkedlist