Write cache matrix functions and update readme with description and code samples