added new function creation, and switching to another function