Yes, this reorders the elements in the p.targets heap array according to their scheduling times. The only reason why you didn't need to initially call Init() in the existing implementation was because you started off with an empty array, which by definition satisfies the heap conditions at the beginning (and then you only use heap operations to mutate the array). But since the replacement case starts off with a populated (but unordered) list, I need to call this in this case. This confused me too, at first.