Rewrote keys with explicit recursion
Merge pull request #48 from kgeorgiy/keys

Rewrote keys with explicit recursion