Filled in cachematrix.R for programming assignment 2