support contraction over more than one index
clean dead code