Changing paths into a 1D array rather than a matrix.