cachematrix.R

Finalized code.