improved dist function with doubles.
removed old result files
updated dist function to use double.