Added a method to display the index when printing a linked_list