rename VarKey to Key, fix state diff, and add comments