Sorted() function working, final commit