pruning seems to work at least for encode