z1 = np.append(z, z[:, -2].reshape(n, 1), axis=1)