implemented openmp support
small fixes