added 3d and 4d arrays