Assigment complete

Wrote functions to use cache to store inverses