Added scheduling functionality. Still need some work.