Fixes #14
Updated to use the new hooks