improvement in linked list code; small changes