added inverse function
removed enum because Rust has it built in