Completed cachematrix.R file