Adding pruning in process