mostly untested hookup code