trying to make heapsort work with dupllicates