Modified code to support mutiple parallel streams. Errors on channel 2 and 3.