Tree speedup

get rid of csgraph, be slightly faster