updated key2remark to write to a file