Create a callback instead of returning the direction function