fix bug with numeric sub key, refactor code
Merge pull request #225 from power-boy1/master

fix bug with numeric sub key, refactor code