fix balanced tree-- remove dead code