edited cachematrix.r for submission/commit