Completed cachematrix.R file for Programming Assignemt 2