fix scheduling
fix variable typo
Merge pull request #1 from jamc/master

Scheduling fixed