Further steps towards writing TNG output. Still not working.

Change-Id: I5d1441ee96a3acb47c51f9447f1e13f5ee67b069