Removed matrix printing from tests
Modified util a bit