included a few modifications to Tensor_integr