I meant the snippets of code that you posted in the first post of this thread - they all look fine to me, including the printf statements, only that INITRUN section does not look right, but that depends on the rest of your script. Of course I don't know what you intend with that system, so I cannot judge if the trades do what they should.