make it work without normalized distances