rewrite channel example to be more advanced