Modified cachematrix.R

Added the implementation for calculating and caching of matrix