refactored code, added exclusion word functionality