Basic heap implementation