modified cachematrix for Assignment 2