little modification of tFlow2Ntriple