Simplified preemptiveHighestPriorityFirst a little and made other minor
changes