Bug fixes and changed output format of pdf  file