added multi-channel support