making is_sorted more general