Adding changes to channel.c