Changed channel code to have a max channels variable. Makes it easier to add new channels into the buffer.