Modified makeVector and cachemean to compute matrix inverse