cashe matrix code for assignment2