Fixed scheduler to use custom binary heap instead of TreeMap