Added functions to create a special matrix object and cache the inverse