improved adaptive proposal code