Implement cachematrix.R with requirements