Changed how the global function is exposed + added local function capability.