got sort function working!!