split looper for parallelization