edited cachematrix.R and wrote the required code