tweaking scheduler code