changes for batch sampling