channel < 0 || channel >= CHANNEL_NUMEL (notice > or =) since I think you are using zero based indexing