Programing Assignment 2: cache matrix