refactored stuff and added OMP implemmentation