implement switch control support

fixes #187