added callback option to output (and updated the doc)