Changed Nd arrays to 1D arrays