rewrite material module