replace tree struct with hash struct