completed linked list implementation