Updated working version of cachematrix.R