Please follow the posting guidelines:
A comment on your code... what you have created DOES not do what you explained in the previous post.
There are several logical errors in your code, so I would suggest to study the tutorials once more.
You only need to create 5 nodes. You are creating 6.
And then you create p2p links just by copying/paste the complete block of code, without understanding what you are doing.