Changed winning condition, and location of winning calculation.