updated with more parallel_for logics