with balance tree method