refactored analysis code a bit and added functionality to find similar words