complete first draft of KeyType