refactoring towards a key depending on entered words. key is length of
word