Winning condition is now funcitonal

There are still some alert boxes, those are to make sure there are no
errors.