added some sort func