fixed typos in distance measure