updates and pruning