added different distance metrics