ironed out win function bugs
Merge branch 'stuff'