this would probably be better in rust
this would probably be better in rust