More work on tree implementation