code formatting
implement win condition