Update cachematrix.R

Final commit. Still unsure about x inheritance.