crappy win function working
slightly better win function added
fixed merge conflict