optimization & corrections