Batching

Closes #282