Added routine for winning condition