realize sorting method according to dictionary's values