update to-function