Implementing hero.prune