changed to keep x,y,z in one large array