added bot play logic