Changed for-loop in wordResemblance()