prune method.