Cache functionality for inverse matrices implemented