adding cosm_logger script, bugfixes to cosm_writer