add example of defining an external function