a lot of changes to scheduler