sortModel updated to use sort states.