Added cache matrix functions & comments