Improved sort algorithms