add support for multiple channels, overall improvements