wrong minmax residual density