removed writeNtuple code