Added winning conditions, and did some fixes.