schedule and assign functions for scheduler, and test case.