I commented out the transposition table code. It is not always playing better. In some games, the AI has a clear win on the next move, however it stays moving other unnecessary pieces. Looks like this happens more often in the endgame.
I use 2 depths because (as you can see from the code above), I do:
1. check if the current depth is the maximum depth (maximum being that of the current iterative of the ID) and if it is, I exit the function, and
2. if current depth == 0, then the search is at the root and I need to save the the move too.
I don't know how I can eliminate one depth variable.