Re-organized sorting algorthms