added function is_sorted
to be done