Modify script to run on functions.