added matrix variables