modify to save noise inv diag