batch mode implemented