New scheduler debugged, appears to be working