Implemented word set creation algorithm