Added post pruning, modified API