adding getKey method to keyGenerator