Added sorting of new cliques to reduce duplicate removal from n^2 to n log n