Updated original cachematrix.R with correct functions