optimizing heap - wrapper