submitting cachematrix.r with edits