Debugging with a custom function