Set up the function