Updated Cached Function Matrix

First attempt to the function