implemented parallel computation