build a binary heap