Fixed bugs. Add OpenMP pragma