added beta queen logic