rewrote aa trees after understand it more and using static global nil