Example of syntax update

All the logic seems OK to me. But several times, I wondered what was happening because the logic structure was not apparent in the code. This is an example of indentation/spaces updates that show how you could better follow our coding convention and make the code understanding simplier.