use openmp and other optimizations