PY3: maxint is not a py3 concept
PY3: smarter sorting