completed cachematrix file for programmingassignment2