Added Rust implementation