use ordered dict instead of sorting keys