alternated X and O, added if statement to prevent X from overwriting O and vice versa