Support for multiple channels and removed some cruft.