Update cachematrix.R

Added a reference to the example that much of the code was adapted from