sort dict, update score