compiling and optimizing add