rewrite lib