implemented primitive version of channel