more parallelization, some optimization