logarithm sort