Andrew update to cachematrix.R

Adding my code to forked cachematrix.R for class