cachematrix.R - Final Version