switch to a function to execute