Start working on sort function