Update cachematrix.R

Adding all the functionality with comments