It seems a little silly to calculate the prunable branches twice, but I can't come up with a way to do it that makes sense.