changed shape parameter to 3D grid