correction and optimization