file cachematrix completed as per assignment instructions