own sort method