added citation info + added code to check whether output files are writable