fattree implementation (and bintree implementation)