winner logic added. needs refactoring