add tensorproduct, some fixes