updated to dictionary sort