for loop replaced with parallel loop