more robust to matrix