use l2 norm istead for dist