rank sort in getTtree