Added hasWonVertical function