Added build tree method to file