adding matixgen