Rewrite it in rust.