Changed all arrays to [N][3] size