added pruning again