replaced ArrayReshape such that it runs in Mma8