adding channels and fixing the code