Refs #8560. Updated for the new API

The provided file used the old API. The code has been updated to use the new API.

The file also needed some global functions defined in it too