Make channel sizes and batch sizes adjustable

Based on @nburtsev work