Your naming scheme gets confusing here as "x1" refers to the "datacube1", but below "x1" and "x0" take on different meanings. I'd drops the 1s here.