Made a tree
fixed a bug in equals
hopefully the final submit