updated setting the whole array so that it can deal with any dimensionality