ttt basic logic