Renamed distance() to dist()