Added tensor self-contraction + minor modifs