adding a link to a node does a realloc. I believe this is causing problems. I am going to replace this and see if that fixes the issue.