Implement indexing on the linked list.