Update cachematrix.R

Updated template functions with my code