Added logic to assign random the mark x/o each player. Code refactored