Completed cachematrix.R

Added comments explaining what the code does.