cacheMatrix wrapper implemented for Assignment 2