Update cachematrix.R

Updated with solution to Assigment 2