adding logging to keygen