building repair tree is functional, but slow