py3 needs key, not cmp for sort