Fixed win condition, some refactoring in board