readTree finally working