using sorted stats