Can you modify the script to handle cases where the function f is not given as a lambda expression but rather as a separate function definition?