Working on nd array