actually good tree code