cache / solve matrix function

functions for assigment 2