Add cons class to create a linked list.