Updated version of cachematrix.R