reset function takes entry point function as parameter