- %\emph{Initialize the sensor node and determine it's position and subregion} \;
-
-\noindent{\bf If} $RE_k \geq E_{th}$ {\bf then}\\
-\hspace*{0.6cm} \emph{$s_k.status$ = COMMUNICATION;}\\
-\hspace*{0.6cm} \emph{Send $INFO()$ packet to other nodes in subregion;}\\
-\hspace*{0.6cm} \emph{Wait $INFO()$ packet from other nodes in subregion;}\\
-\hspace*{0.6cm} \emph{Update K.CurrentSize;}\\
-\hspace*{0.6cm} \emph{LeaderID = Leader election;}\\
-\hspace*{0.6cm} {\bf If} $ s_k.ID = LeaderID $ {\bf then}\\
-\hspace*{1.2cm} \emph{$s_k.status$ = COMPUTATION;}\\
-\hspace*{1.2cm}{\bf If} \emph{$ s_k.ID $ is Not previously selected as a Leader} {\bf then}\\
-\hspace*{1.8cm} \emph{ Execute the perimeter coverage model;}\\
-\hspace*{1.2cm} {\bf end}\\
-\hspace*{1.2cm}{\bf If} \emph{($s_k.ID $ is the same Previous Leader)~And~(K.CurrentSize = K.PreviousSize)}\\
-\hspace*{1.8cm} \emph{ Use the same previous cover set for current sensing stage;}\\
-\hspace*{1.2cm} {\bf end}\\
-\hspace*{1.2cm} {\bf else}\\
-\hspace*{1.8cm}\emph{Update $a^j_{ik}$; prepare data for IP~Algorithm;}\\
-\hspace*{1.8cm} \emph{$\left\{\left(X_{1},\dots,X_{l},\dots,X_{K}\right)\right\}$ = Execute Integer Program Algorithm($K$);}\\
-\hspace*{1.8cm} \emph{K.PreviousSize = K.CurrentSize;}\\
-\hspace*{1.2cm} {\bf end}\\
-\hspace*{1.2cm}\emph{$s_k.status$ = COMMUNICATION;}\\
-\hspace*{1.2cm}\emph{Send $ActiveSleep()$ to each node $l$ in subregion;}\\
-\hspace*{1.2cm}\emph{Update $RE_k $;}\\
-\hspace*{0.6cm} {\bf end}\\
-\hspace*{0.6cm} {\bf else}\\
-\hspace*{1.2cm}\emph{$s_k.status$ = LISTENING;}\\
-\hspace*{1.2cm}\emph{Wait $ActiveSleep()$ packet from the Leader;}\\
-\hspace*{1.2cm}\emph{Update $RE_k $;}\\
-\hspace*{0.6cm} {\bf end}\\
-{\bf end}\\
-{\bf else}\\
-\hspace*{0.6cm} \emph{Exclude $s_k$ from entering in the current sensing stage;}\\
-{\bf end}\\
-\label{alg:PeCO}
-\end{algorithm}
-
-
+ %\emph{Initialize the sensor node and determine it's position and subregion} \;
+ \caption{PeCO pseudocode}
+ \eIf{$RE_k \geq E_{th}$}{
+ $s_k.status$ = COMMUNICATION\;
+ Send $INFO()$ packet to other nodes in subregion\;
+ Wait $INFO()$ packet from other nodes in subregion\;
+ Update K.CurrentSize\;
+ LeaderID = Leader election\;
+ \eIf{$s_k.ID = LeaderID$}{
+ $s_k.status$ = COMPUTATION\;
+ \If{$ s_k.ID $ is Not previously selected as a Leader}{
+ Execute the perimeter coverage model\;
+ }
+ \eIf{($s_k.ID $ is the same Previous Leader) {\bf and} \\
+ \indent (K.CurrentSize = K.PreviousSize)}{
+ Use the same previous cover set for current sensing stage\;
+ }{
+ Update $a^j_{ik}$; prepare data for IP~Algorithm\;
+ $\left\{\left(X_{1},\dots,X_{l},\dots,X_{K}\right)\right\}$ = Execute Integer Program Algorithm($K$)\;
+ K.PreviousSize = K.CurrentSize\;
+ }
+ $s_k.status$ = COMMUNICATION\;
+ Send $ActiveSleep()$ to each node $l$ in subregion\;
+ Update $RE_k $\;
+ }{
+ $s_k.status$ = LISTENING\;
+ Wait $ActiveSleep()$ packet from the Leader\;
+ Update $RE_k $\;
+ }
+ }{
+ Exclude $s_k$ from entering in the current sensing stage\;
+ }
+\end{algorithm2e}
+
+%\begin{algorithm}
+%\noindent{\bf If} $RE_k \geq E_{th}$ {\bf then}\\
+%\hspace*{0.6cm} \emph{$s_k.status$ = COMMUNICATION;}\\
+%\hspace*{0.6cm} \emph{Send $INFO()$ packet to other nodes in subregion;}\\
+%\hspace*{0.6cm} \emph{Wait $INFO()$ packet from other nodes in subregion;}\\
+%\hspace*{0.6cm} \emph{Update K.CurrentSize;}\\
+%\hspace*{0.6cm} \emph{LeaderID = Leader election;}\\
+%\hspace*{0.6cm} {\bf If} $ s_k.ID = LeaderID $ {\bf then}\\
+%\hspace*{1.2cm} \emph{$s_k.status$ = COMPUTATION;}\\
+%\hspace*{1.2cm}{\bf If} \emph{$ s_k.ID $ is Not previously selected as a Leader} {\bf then}\\
+%\hspace*{1.8cm} \emph{ Execute the perimeter coverage model;}\\
+%\hspace*{1.2cm} {\bf end}\\
+%\hspace*{1.2cm}{\bf If} \emph{($s_k.ID $ is the same Previous Leader)~And~(K.CurrentSize = K.PreviousSize)}\\
+%\hspace*{1.8cm} \emph{ Use the same previous cover set for current sensing stage;}\\
+%\hspace*{1.2cm} {\bf end}\\
+%\hspace*{1.2cm} {\bf else}\\
+%\hspace*{1.8cm}\emph{Update $a^j_{ik}$; prepare data for IP~Algorithm;}\\
+%\hspace*{1.8cm} \emph{$\left\{\left(X_{1},\dots,X_{l},\dots,X_{K}\right)\right\}$ = Execute Integer Program Algorithm($K$);}\\
+%\hspace*{1.8cm} \emph{K.PreviousSize = K.CurrentSize;}\\
+%\hspace*{1.2cm} {\bf end}\\
+%\hspace*{1.2cm}\emph{$s_k.status$ = COMMUNICATION;}\\
+%\hspace*{1.2cm}\emph{Send $ActiveSleep()$ to each node $l$ in subregion;}\\
+%\hspace*{1.2cm}\emph{Update $RE_k $;}\\
+%\hspace*{0.6cm} {\bf end}\\
+%\hspace*{0.6cm} {\bf else}\\
+%\hspace*{1.2cm}\emph{$s_k.status$ = LISTENING;}\\
+%\hspace*{1.2cm}\emph{Wait $ActiveSleep()$ packet from the Leader;}\\
+%\hspace*{1.2cm}\emph{Update $RE_k $;}\\
+%\hspace*{0.6cm} {\bf end}\\
+%{\bf end}\\
+%{\bf else}\\
+%\hspace*{0.6cm} \emph{Exclude $s_k$ from entering in the current sensing stage;}\\
+%{\bf end}\\
+%\label{alg:PeCO}
+%\end{algorithm}