Finished re-implement schedule on/off function.