Solved the linked list bug like a boss