Implementation of the pruning strategy