code and documentation tidyup
added output_format option
added output_format option