Finalized similarity calculation, runs on n cpu correctly. Wooohooo.