Update cachematrix.R

final version for R - Programming Assignment 2