modified cachematrix.R to finish the assignnment