make sorting deterministic