Update cachematrix.R

Updated into psuedocode and added some comments.