Made a few minor changes, test case and inverse work much better. Committing before some larger alterations