Take into account suggestions of Emmanuel
This includes an important change in the code since one cannot reuse a variable name in a nested block (this means that if a variable is declared, one cannot declare a variable with a same name even in a nested block, while the first variable exists).