corrections and optimizing