updated index stuff to work with new tensor lib changes