added matrix testing