Massive changes, using CSV from  matlab, creates a table of distances at the  end.