added definition of named functions, fixed reversed arg order in
compiled functions