(seems to work), already faster than ordinary sort