I am creating a beamer presentation. I try to create a tikz flow chart. Here is my production. T_T

Actually, what I want to do is

Be grateful with any help! So frustrated now.
\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\pagestyle{empty}
% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
text width=5em, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\begin{tikzpicture}[node distance = 2cm, auto]
% Place nodes
\node [block] (begin) {begin};
\node [block, below of=begin] (input) {input};
\node [block, below of=input] (data) {initdata };
\node [decision, below of=data] (judge) {judge the data};
\node [block, right of=judge, node distance=4cm] (output) {update model};
\node [block, below of=judge] (sum) {s=s+(i-1)};
\node [block, below of=sum, node distance=3cm] (increase) {i=i+1};
% Draw edges
\path [line] (begin) -- (input);
\path [line] (input) -- (data);
\path [line] (data) -- (judge);
\path [line] (sum) -- (increase);
\path [line] (judge) -| node [near start] {no} (output);
\path [line] (judge) |- node [near start]{yes}(sum);
\path [line] (increase)--(judge);
\end{tikzpicture}
\end{document}
