Handle big matrices more intelligently