modified rankSimilarity to work with numbers instead than with strings