Some additions to functions