Submission of cachematrix function

Caches matrix to cut down on computation time.