Update cachematrix.R

My solution to assignment 2.