Multi-dimensional array implementation