swaplist
swap, tree, freqlist2tree
everything up to building tree seems to work