fixing dykstra, forgot to add the sum of the distance instead of just the single distance