rewrite for graphite