function to run a function in a file