changes to batchsize code. this needs more thought