implemented c++ version of parallelization equation