Added method to determine if linked list is sorted