ProgrammingAssignment2 can create inverse matrix and cache it