moved TensorDerivative to own function