Got Rust implementation working