make sort functions static