Winning doesn't work

I don't know why, but it doesn't. Off by one error with undo but it kind
of works.