better logging; sort accurate