clean up
export the foreign functions