update to cacheMatrix.R

updated with expanded comments and example usage.