Moved check victory into its own funciton.