add logic to count the phrase pairs