generating proper key files