Completed Programming assignment 2.  Cached inverse functions