Fixed the sort, looks like I had this one wrong initially.