Unfinished genSchedule function

Wanted to commit because I just fixed a totally baffling bug.