Beginning of code to construct a TAG