added optimizations for compiling