improved ordering for dictionary keys