added hooks.

closes #7.