0) - modified bitree's algorithm