cachematrix.R coded and submitted for assignment