Modified cachematrix.R

Modified cachematrix.R to cache and calculate matrix and inverse matrix.