definition and execution of a custom function