Updated cachematrix.R with solution to programming assignment 2