Initial commit; converting from C to Rust