Finished the cachematrix.R as per the assignment requirements