added synchronized block to a few parallel algos