split into files, added parametrized tree example