Added new code that dynamically displays the batch functions based on the users current state;