my version of the cache matrix code