Implemented everything up until the custom scheduler.