linked list now works