Replaced ++;  for += 1;

Signed-off-by: Filiberto Cota <filiberto.cota@gmail.com>
set all variable declarations to the top of the functions

Signed-off-by: Filiberto Cota <filiberto.cota@gmail.com>