implemented basic heap