added pruning