Update cachematrix.R

Own solution to exercise 2