Fixed Major Errors in Scheduling Algorithm

Misplaced Variables in Calculation; Seems to work much better.