Adding clustering popular terms functionality