implemented reading/writing N-dimensional arrays