build gramma tree