fix tree branches layout + weight + rank