Update cachematrix.R

Updated with my solution to Assignment 2!