Linked List without using global variables