modified mostSimilar.py