support using a function as the origin option