change heap template parameter so it can use user-defined compare function.