nearly works

- a few minor bugs in the linked list