stash improved sort and indexes
improve sort method