optimization and refactoring
fixed bug checking win information
optimization and refactoring