version with exact word match algorithm