modified for KKT MMSE