significant amount of code added to prepare for parallelization. hopefully no bugs were introduced, but we never know