make number of channels configurable - from agrueneberg's fork