Using a heap works! Except for one triangle hole that has been left over … :/