Simulation / python / grasshopper

Hello @BrianJ , thank you for your reply , i will post it in the scripting category .
as for what GH definition is intend for , its a circle packing algorithm which i am trying to simulate it , i solved the last error and now the definition is one step further .
now my the definition works correctly with less than 10 point , here is the definition which work correct and have less than 10 point :
1.gh (11.2 KB)

but right after i increase the number of points to more than 10 (( 13 in file 2.gh )) it gives me an strange error :
Runtime error (InvalidCastException): Specified cast is not valid.
i searched for the error but it seems like there is nothing of this error in python , all i found was for C# and other languages .
here is second file :

2.gh (11.6 KB)

so please take a look at these two files , an help me plz .
thank you .