fixed sort issue
Made a basic library.  the sort functions must move