first version of htree workig