Custom Function moved

The custom function has been removed from this script and added to the
Functions File