adding linked list code for reference