sorting built ranks