doc as fn works