Added depth testing to speed up minimax algorithm