almost all working now... still need to fix up generate_schedule