Adding win checking. Next is AI.