X or O function determining function