Beginning huge refactor of win-checking functions; peek at your own risk!