refactored win condition version1