Added new function resorted(). sorted() calls moved to resorted().
Added some testing resources.