Update cachematrix.R

My potential solution to Programming Assignment 2