Refactoring and optimization.
Added state-forcing and maximum correction cap.