Adjust similarity calculation