distances were incorrectly numpy arrays instead of floats