refactoring hash tree
set is now implemented in terms of tree