Update cachematrix.R

Add more comments and make function more readable by adding {} around single-lined actions.