modified cachematrix.R and added test.R for testing