This cuts off the first cost that should also be part of the total distance. The sizes of the path and the distance matrix doesn't match.