i think i found the issue. i allowed setNext to work if next != 0, instead of if next == 0