new output file method and small new comments