Moved memory dealocation.

Divided iterations by the nodes count.