pseudo batch loop