altering generateKey