refined code for 3000 distinct titles for speed up clustering