Fixed NIL output with only one reference point, also added Distance output