added matrix mode