Modify demping algorithm