The square root from calculating the Euclidean distance was removed to increase speed