a super ugly implementation of channels