Added ability for custom functions