refactoring and verified cypher works up to key 99