File updated to include functions for caching inverse matricies