Implemented own sort for Join