updated 'key_value' method