error adjustments and optimizations