minor
minor
rewrite distance and R script
rewrite distance and R script