moved heap to head