added functions and comments to cachematrix.R