Tidied up the key method.

Better comments.