updated cachematrix for assignment 2