Completely rewrote scheduling algorithm to use backtracking search.