added writeNTriples