win logic added