Minmax tree implemented, but there is some bugs