Filled out while_scheduling function.  Changes to other while_state functions for consistency.