Update cachematrix.R

Commit tries to cache the calculation of the cache instead of doing it every time.
This should save time and effort.