refined the process for keyword files. fixes #41