first working hooks and a unit test that exercises them