Added README and made truncateMat into a public function.