put together and tested cachematrix.R