[bineary heap] started rewriting