Initial work on creating non local function