added key generation