introduced Channel class, added logic to build up the channel from scratch.