first implementation for the Ai test