Implementing cache matrix implementation.

Implementing cache matrix implementation and adding a message if value
is retrieved from cache.