add from to function