Moved datacube implementation to cpp