use marshalling to transfer origin functions