Moved scheduler algo in the common branch.