Implement two versions of variable tree computation