Updated cachematrix.R with my solution.