corrected calculateSimilartiy.py