fixed bugs, added multi channel functionality