genetic sort optimized