Modified cachematrix.R with solution to week 2 programming assignment.