submit assignment 2

Completes cache matrix function for programming assignment.