improved multidim arrays and fixed tag error in generate