some documentation and examples on custom functions