lecture: lecture 15: finish valToFun