Add is_sorted method