added multiplex support via a few additional options