added a batch mode to mapper