better build-gp-tree, but still assumes all functions have 2 args