Added compile-time optimizations and omp parallelization