Made changes to reflect the parallel version of the code