implemented grail format output and quit on 0 from subment
removed TODO