Please edit your post #10, select all code and click the </> button to apply so-called code tags and next save your post. It makes it easier to read, easier to copy, maintains the indentations and prevents the forum software from incorrect interpretation of the code.