Cachematrix.R filled in with my code