Formatted code parts

I formatted the code blocks and substituted the tab by four spaces.